home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 722 / 722.xpi / components / noscriptService.js
Text File  |  2010-02-12  |  2KB  |  53 lines

  1. // XPCOM scaffold
  2.  
  3. const CI = Components.interfaces;
  4. const CC = Components.classes;
  5. const CU = Components.utils;
  6.  
  7. const EXTENSION_ID = "{73a6fe31-595d-460b-a920-fcc0f8843232}";
  8. const EXTENSION_NAME = "NoScript";
  9. const CHROME_NAME = "noscript";
  10. const VERSION = "1.9.9.47";
  11. const SERVICE_NAME = EXTENSION_NAME + " Service";
  12. const SERVICE_CTRID = "@maone.net/noscript-service;1";
  13. const SERVICE_ID="{31aec909-8e86-4397-9380-63a59e0c5ff5}";
  14.  
  15. // interfaces implemented by this component
  16. const SERVICE_IIDS = 
  17. CI.nsIObserver,
  18. CI.nsISupports,
  19. CI.nsISupportsWeakReference,
  20. CI.nsIContentPolicy,
  21. CI.nsIWebProgressListener,
  22. CI.nsIChannelEventSink
  23. ];
  24.  
  25. // categories which this component is registered in
  26. const SERVICE_CATS = ["app-startup", "content-policy"];
  27.  
  28. const IOS = CC["@mozilla.org/network/io-service;1"].getService(CI.nsIIOService);
  29. const OS = CC['@mozilla.org/observer-service;1'].getService(CI.nsIObserverService);
  30. const LOADER = CC["@mozilla.org/moz/jssubscript-loader;1"].getService(CI.mozIJSSubScriptLoader);
  31. const _INCLUDED = {};
  32. const INCLUDE = function(name) {
  33.   if (arguments.length > 1)
  34.     for (var j = 0, len = arguments.length; j < len; j++)
  35.       arguments.callee(arguments[j]);
  36.   else if (!_INCLUDED[name]) {
  37.     try {
  38.       LOADER.loadSubScript("chrome://noscript/content/"+ name + ".js");
  39.       _INCLUDED[name] = true;
  40.     } catch(e) {
  41.       dump("INCLUDE " + name + ": " + e + "\n");
  42.     }
  43.   }
  44. }
  45.  
  46. var singleton;
  47. const SERVICE_CONSTRUCTOR = function() {
  48.   INCLUDE("Main");
  49.   return singleton;
  50. }
  51.  
  52. INCLUDE("XPCOM");